<?php
/*************************************************************************
Module News
----------------------------------------------------------------
Derasoft CMS Project
Company: Derasoft Co., Ltd                                  
Name: Tran Thi Kim Que                                  
Last updated: 23/11/2009
**************************************************************************/
include_once(ROOT_PATH."classes/dao/entries.class.php");
include_once(ROOT_PATH."classes/dao/categories.class.php");
$entries = new Entries();
$categories = new Categories();
$templateFile = "newdetail.tpl.html";
$slug = $request->element('slug');
$page = $request->element('page',1);
$detailItem = $entries->getEntryFromSlug($slug);
if($detailItem) {
	$catId = $detailItem->getCId();
	$id   = $detailItem->getId();
	$activeItems= $categories->getParentAllFromCid($catId,$lang.'_name');
	$active=$activeItems[0];
	$title=$activeItems[1]['0'];
	$template->assign('active',$active);
	$related_news_per_page = $siteConfigs->getProperty('related_news_per_page');
	$otherNewsItems = $entries->getObjects(1,"status=1 AND  id!=".$id." AND cid=$catId",array('date_created'=>'DESC'),$related_news_per_page);
	$template->assign("detailItem",$detailItem);	
	$template->assign("otherNewsItems",$otherNewsItems);
	$template->assign("slug",$slug);
	$template->assign("page",$page);
	$cateNameItem=$categories->getObject($catId);
	$template->assign('cateNameItem',$cateNameItem);
	$pageName = $detailItem->getTitle($lang);
	$template->assign('pageName',$pageName);
	$template->assign('title',$title);
}else{

$pageName = $messages["news"];
$template->assign('pageName',$pageName);
}
  #dung chung
  include_once(ROOT_PATH."modules/framework.module.php");
#active
 // $active='tin-tuc';
 //$template->assign('active',$active);

?>